<?php @session_start();
if (isset($_SESSION['uname'])){ $user=$_SESSION['uname']; echo " welcome $user <a href=\"logout.php\"> logout </a>"; }else

{?>
<form method="post" action="dologin.php">
user  :<input type="text" name="uname" /><br />
password:<input type="password" name="pass" />
<input type="submit" name="submit" value="submit" />
</form>
<?php }?>